package com.zzrc.grape.controller;

import com.zzrc.grape.model.testTool.EnDecrypReq;
import com.zzrc.grape.service.TestToolService;
import com.zzrc.grape.util.BaseResponseData;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;

import javax.annotation.Resource;

@Controller
@RequestMapping("testTool")
public class TestToolController {
    @Resource
    TestToolService testToolService;

    @RequestMapping("goEnDecrypIndex")
    public ModelAndView goEnDecrypIndex() {
        return new ModelAndView("/testTool/enDecryp");
    }

    @RequestMapping("enDecryp")
    @ResponseBody
    public BaseResponseData enDecryp(@RequestBody EnDecrypReq enDecrypReq) {
        return testToolService.enDecryp(enDecrypReq);
    }
}
